package com.zhou.cloud.gateway.controller;


import cn.hutool.system.SystemUtil;
import cn.hutool.system.oshi.OshiUtil;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhouyongjun
 * @Description:
 * @date 2021/9/26 11:21
 */
@RestController
public class GatewayController {
    @RequestMapping("/fallback")
    public String fallback() {
        return "This is a fallback";
    }

    @RequestMapping("/hutools/systemutil")
    public Object hutools() {
        System.out.println("hutools");
        JSONObject jsonObject = new JSONObject();
//        SystemUtil.dumpSystemInfo();
//        return JSONObject.toJSONString(SystemUtil.getJvmSpecInfo());
//        return  SystemUtil.getJavaInfo();
//        return SystemUtil.getJvmInfo();
        return SystemUtil.getRuntimeInfo();
    }
    /*
    {
    "total": 16881111040,
    "physicalMemory": [
        {
            "bankLabel": "",
            "capacity": 17179869184,
            "clockSpeed": 3200000000,
            "manufacturer": "80CE000080CE",
            "memoryType": "DDR4"
        }
    ],
    "pageSize": 4096,
    "available": 2093527040,
    "virtualMemory": {
        "swapTotal": 8589934592,
        "swapPagesIn": 32856706,
        "swapPagesOut": 3479757,
        "virtualInUse": 24216981504,
        "virtualMax": 25471045632,
        "swapUsed": 1443213312
    }
}
     */
    @RequestMapping("/hutools/oshi/memory")
    public Object oshiMemory() {
        return OshiUtil.getMemory();
    }
    @RequestMapping("/hutools/oshi/os")
    public Object oshiOs() {
        return OshiUtil.getOs();
    }

    @RequestMapping("/hutools/oshi/processor")
    public Object oshiProcessor() {
        return OshiUtil.getProcessor();
    }
    @RequestMapping("/hutools/oshi/Hardware")
    public Object oshiHardware() {
        return OshiUtil.getHardware();
    }
    @RequestMapping("/hutools/oshi/sensors")
    public Object oshiSensors() {
        return OshiUtil.getSensors();
    }
    /*{
    "firmware": {
        "version": "DELL   - 1072009",
        "description": "1.0.7",
        "manufacturer": "Dell Inc.",
        "releaseDate": "2020-05-15",
        "name": "1.0.7"
    },
    "baseboard": {
        "version": "A01",
        "serialNumber": "/C9JZJ53/CNFCW0006A00MU/",
        "manufacturer": "Dell Inc.",
        "model": "unknown"
    },
    "serialNumber": "C9JZJ53",
    "manufacturer": "Dell Inc.",
    "hardwareUUID": "4C4C4544-0039-4A10-805A-C3C04F4A3533",
    "model": "OptiPlex 7080"
}
    @RequestMapping("/hutools/oshi/system")
    public Object oshiSystem() {
        return OshiUtil.getSystem();
    }

    /*
    [
    {
        "name": "\\\\.\\PHYSICALDRIVE1",
        "model": "SSD 256G (标准磁盘驱动器)",
        "serial": "K25FHS0700490",
        "size": 256052966400,
        "reads": 4193138,
        "readBytes": 115221118976,
        "writes": 8626371,
        "writeBytes": 187072749056,
        "currentQueueLength": 0,
        "transferTime": 9304935,
        "timeStamp": 1632650767864,
        "partitions": [
            {
                "identification": "磁盘 #1，分区 #1",
                "name": "GPT: Basic Data",
                "type": "GPT: 基本数据",
                "uuid": "bdec7ac5-8d98-4c96-a205-3791d1f72fff",
                "size": 255341859840,
                "major": 1,
                "minor": 1,
                "mountPoint": "C:\\"
            }
        ]
    },
    {
        "name": "\\\\.\\PHYSICALDRIVE0",
        "model": "ST2000DM005-2CW102 (标准磁盘驱动器)",
        "serial": "            WFM22S3W",
        "size": 2000396321280,
        "reads": 976591,
        "readBytes": 13671147520,
        "writes": 436506,
        "writeBytes": 5142188032,
        "currentQueueLength": 0,
        "transferTime": 7037325,
        "timeStamp": 1632650767864,
        "partitions": [
            {
                "identification": "磁盘 #0，分区 #0",
                "name": "GPT: Basic Data",
                "type": "GPT: 基本数据",
                "uuid": "5de1bd8e-98a8-4331-a84d-e050fceda62c",
                "size": 1001390080000,
                "major": 0,
                "minor": 0,
                "mountPoint": "F:\\"
            },
            {
                "identification": "磁盘 #0，分区 #1",
                "name": "GPT: Basic Data",
                "type": "GPT: 基本数据",
                "uuid": "3d2bb195-6f51-4b28-8fb0-d7d775e4b17e",
                "size": 999006666752,
                "major": 0,
                "minor": 1,
                "mountPoint": "G:\\"
            }
        ]
    }
]
     */
    @RequestMapping("/hutools/oshi/DiskStores")
    public Object oshiDiskStores() {
        return OshiUtil.getDiskStores();
    }

    /*
    {
    "cpuNum": 16,
    "toTal": 16745,
    "sys": 3.44,
    "used": 4.94,
    "wait": 0,
    "free": 91.53,
    "cpuModel": "Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz\n 1 physical CPU package(s)\n 8 physical CPU core(s)\n 16 logical CPU(s)\nIdentifier: Intel64 Family 6 Model 165 Stepping 5\nProcessorID: BFEBFBFF000A0655\nMicroarchitecture: unknown",
    "ticks": {
        "idle": 15326,
        "nice": 0,
        "irq": 0,
        "softIrq": 16,
        "steal": 0,
        "cSys": 576,
        "user": 827,
        "ioWait": 0
    }
}
     */
    @RequestMapping("/hutools/oshi/cpu")
    public Object oshiCpu() {
        return OshiUtil.getCpuInfo();
    }
    /*
    {
    "processID": 18528,
    "commandLine": "\"F:\\Program Files\\Java\\jdk1.8.0_261\\bin\\java.exe\" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:58258,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -javaagent:C:\\Users\\zhouyongjun\\AppData\\Local\\JetBrains\\IntelliJIdea2020.1\\captureAgent\\debugger-agent.jar -Dfile.encoding=UTF-8 -classpath \"F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\charsets.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\deploy.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\ext\\access-bridge-64.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\ext\\cldrdata.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\ext\\dnsns.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\ext\\jaccess.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\ext\\jfxrt.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\ext\\localedata.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\ext\\nashorn.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\ext\\sunec.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\ext\\sunjce_provider.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\ext\\sunmscapi.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\ext\\sunpkcs11.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\ext\\zipfs.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\javaws.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\jce.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\jfr.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\jfxswt.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\jsse.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\management-agent.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\plugin.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\resources.jar;F:\\Program Files\\Java\\jdk1.8.0_261\\jre\\lib\\rt.jar;G:\\git\\gitee\\test\\springcloud\\alibaba\\demo1\\gateway-9001\\target\\classes;G:\\maven\\.m2\\repository\\org\\springframework\\cloud\\spring-cloud-starter-gateway\\2.2.5.RELEASE\\spring-cloud-starter-gateway-2.2.5.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\cloud\\spring-cloud-starter\\2.2.5.RELEASE\\spring-cloud-starter-2.2.5.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\boot\\spring-boot-starter\\2.3.0.RELEASE\\spring-boot-starter-2.3.0.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\boot\\spring-boot\\2.3.0.RELEASE\\spring-boot-2.3.0.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\boot\\spring-boot-starter-logging\\2.3.0.RELEASE\\spring-boot-starter-logging-2.3.0.RELEASE.jar;G:\\maven\\.m2\\repository\\ch\\qos\\logback\\logback-classic\\1.2.3\\logback-classic-1.2.3.jar;G:\\maven\\.m2\\repository\\ch\\qos\\logback\\logback-core\\1.2.3\\logback-core-1.2.3.jar;G:\\maven\\.m2\\repository\\org\\apache\\logging\\log4j\\log4j-to-slf4j\\2.13.2\\log4j-to-slf4j-2.13.2.jar;G:\\maven\\.m2\\repository\\org\\apache\\logging\\log4j\\log4j-api\\2.13.2\\log4j-api-2.13.2.jar;G:\\maven\\.m2\\repository\\org\\slf4j\\jul-to-slf4j\\1.7.30\\jul-to-slf4j-1.7.30.jar;G:\\maven\\.m2\\repository\\jakarta\\annotation\\jakarta.annotation-api\\1.3.5\\jakarta.annotation-api-1.3.5.jar;G:\\maven\\.m2\\repository\\org\\springframework\\spring-core\\5.2.6.RELEASE\\spring-core-5.2.6.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\spring-jcl\\5.2.6.RELEASE\\spring-jcl-5.2.6.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\yaml\\snakeyaml\\1.23\\snakeyaml-1.23.jar;G:\\maven\\.m2\\repository\\org\\springframework\\cloud\\spring-cloud-context\\2.2.5.RELEASE\\spring-cloud-context-2.2.5.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\security\\spring-security-crypto\\5.3.2.RELEASE\\spring-security-crypto-5.3.2.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\cloud\\spring-cloud-commons\\2.2.5.RELEASE\\spring-cloud-commons-2.2.5.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\security\\spring-security-rsa\\1.0.9.RELEASE\\spring-security-rsa-1.0.9.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\bouncycastle\\bcpkix-jdk15on\\1.64\\bcpkix-jdk15on-1.64.jar;G:\\maven\\.m2\\repository\\org\\bouncycastle\\bcprov-jdk15on\\1.64\\bcprov-jdk15on-1.64.jar;G:\\maven\\.m2\\repository\\org\\springframework\\cloud\\spring-cloud-gateway-core\\2.2.5.RELEASE\\spring-cloud-gateway-core-2.2.5.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\boot\\spring-boot-starter-validation\\2.3.0.RELEASE\\spring-boot-starter-validation-2.3.0.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\glassfish\\jakarta.el\\3.0.3\\jakarta.el-3.0.3.jar;G:\\maven\\.m2\\repository\\org\\hibernate\\validator\\hibernate-validator\\6.1.5.Final\\hibernate-validator-6.1.5.Final.jar;G:\\maven\\.m2\\repository\\jakarta\\validation\\jakarta.validation-api\\2.0.2\\jakarta.validation-api-2.0.2.jar;G:\\maven\\.m2\\repository\\org\\jboss\\logging\\jboss-logging\\3.4.1.Final\\jboss-logging-3.4.1.Final.jar;G:\\maven\\.m2\\repository\\com\\fasterxml\\classmate\\1.5.1\\classmate-1.5.1.jar;G:\\maven\\.m2\\repository\\io\\projectreactor\\addons\\reactor-extra\\3.3.3.RELEASE\\reactor-extra-3.3.3.RELEASE.jar;G:\\maven\\.m2\\repository\\io\\projectreactor\\reactor-core\\3.3.5.RELEASE\\reactor-core-3.3.5.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\boot\\spring-boot-starter-webflux\\2.3.0.RELEASE\\spring-boot-starter-webflux-2.3.0.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\boot\\spring-boot-starter-json\\2.3.0.RELEASE\\spring-boot-starter-json-2.3.0.RELEASE.jar;G:\\maven\\.m2\\repository\\com\\fasterxml\\jackson\\datatype\\jackson-datatype-jdk8\\2.11.0\\jackson-datatype-jdk8-2.11.0.jar;G:\\maven\\.m2\\repository\\com\\fasterxml\\jackson\\datatype\\jackson-datatype-jsr310\\2.11.0\\jackson-datatype-jsr310-2.11.0.jar;G:\\maven\\.m2\\repository\\com\\fasterxml\\jackson\\module\\jackson-module-parameter-names\\2.11.0\\jackson-module-parameter-names-2.11.0.jar;G:\\maven\\.m2\\repository\\org\\springframework\\boot\\spring-boot-starter-reactor-netty\\2.3.0.RELEASE\\spring-boot-starter-reactor-netty-2.3.0.RELEASE.jar;G:\\maven\\.m2\\repository\\io\\projectreactor\\netty\\reactor-netty\\0.9.7.RELEASE\\reactor-netty-0.9.7.RELEASE.jar;G:\\maven\\.m2\\repository\\io\\netty\\netty-codec-http\\4.1.49.Final\\netty-codec-http-4.1.49.Final.jar;G:\\maven\\.m2\\repository\\io\\netty\\netty-common\\4.1.49.Final\\netty-common-4.1.49.Final.jar;G:\\maven\\.m2\\repository\\io\\netty\\netty-buffer\\4.1.49.Final\\netty-buffer-4.1.49.Final.jar;G:\\maven\\.m2\\repository\\io\\netty\\netty-transport\\4.1.49.Final\\netty-transport-4.1.49.Final.jar;G:\\maven\\.m2\\repository\\io\\netty\\netty-codec\\4.1.49.Final\\netty-codec-4.1.49.Final.jar;G:\\maven\\.m2\\repository\\io\\netty\\netty-codec-http2\\4.1.49.Final\\netty-codec-http2-4.1.49.Final.jar;G:\\maven\\.m2\\repository\\io\\netty\\netty-handler\\4.1.49.Final\\netty-handler-4.1.49.Final.jar;G:\\maven\\.m2\\repository\\io\\netty\\netty-resolver\\4.1.49.Final\\netty-resolver-4.1.49.Final.jar;G:\\maven\\.m2\\repository\\io\\netty\\netty-handler-proxy\\4.1.49.Final\\netty-handler-proxy-4.1.49.Final.jar;G:\\maven\\.m2\\repository\\io\\netty\\netty-codec-socks\\4.1.49.Final\\netty-codec-socks-4.1.49.Final.jar;G:\\maven\\.m2\\repository\\io\\netty\\netty-transport-native-epoll\\4.1.49.Final\\netty-transport-native-epoll-4.1.49.Final-linux-x86_64.jar;G:\\maven\\.m2\\repository\\io\\netty\\netty-transport-native-unix-common\\4.1.49.Final\\netty-transport-native-unix-common-4.1.49.Final.jar;G:\\maven\\.m2\\repository\\org\\springframework\\spring-web\\5.2.6.RELEASE\\spring-web-5.2.6.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\spring-beans\\5.2.6.RELEASE\\spring-beans-5.2.6.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\spring-webflux\\5.2.6.RELEASE\\spring-webflux-5.2.6.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\synchronoss\\cloud\\nio-multipart-parser\\1.1.0\\nio-multipart-parser-1.1.0.jar;G:\\maven\\.m2\\repository\\org\\synchronoss\\cloud\\nio-stream-storage\\1.1.3\\nio-stream-storage-1.1.3.jar;G:\\maven\\.m2\\repository\\org\\springframework\\cloud\\spring-cloud-starter-netflix-hystrix\\2.2.5.RELEASE\\spring-cloud-starter-netflix-hystrix-2.2.5.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\cloud\\spring-cloud-netflix-hystrix\\2.2.5.RELEASE\\spring-cloud-netflix-hystrix-2.2.5.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\boot\\spring-boot-autoconfigure\\2.3.0.RELEASE\\spring-boot-autoconfigure-2.3.0.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\cloud\\spring-cloud-netflix-ribbon\\2.2.5.RELEASE\\spring-cloud-netflix-ribbon-2.2.5.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\cloud\\spring-cloud-netflix-archaius\\2.2.5.RELEASE\\spring-cloud-netflix-archaius-2.2.5.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\cloud\\spring-cloud-starter-netflix-archaius\\2.2.5.RELEASE\\spring-cloud-starter-netflix-archaius-2.2.5.RELEASE.jar;G:\\maven\\.m2\\repository\\com\\netflix\\archaius\\archaius-core\\0.7.6\\archaius-core-0.7.6.jar;G:\\maven\\.m2\\repository\\com\\google\\code\\findbugs\\jsr305\\3.0.1\\jsr305-3.0.1.jar;G:\\maven\\.m2\\repository\\commons-configuration\\commons-configuration\\1.8\\commons-configuration-1.8.jar;G:\\maven\\.m2\\repository\\commons-lang\\commons-lang\\2.6\\commons-lang-2.6.jar;G:\\maven\\.m2\\repository\\com\\netflix\\hystrix\\hystrix-core\\1.5.18\\hystrix-core-1.5.18.jar;G:\\maven\\.m2\\repository\\io\\reactivex\\rxjava\\1.3.8\\rxjava-1.3.8.jar;G:\\maven\\.m2\\repository\\org\\hdrhistogram\\HdrHistogram\\2.1.9\\HdrHistogram-2.1.9.jar;G:\\maven\\.m2\\repository\\com\\netflix\\hystrix\\hystrix-serialization\\1.5.18\\hystrix-serialization-1.5.18.jar;G:\\maven\\.m2\\repository\\com\\fasterxml\\jackson\\module\\jackson-module-afterburner\\2.11.0\\jackson-module-afterburner-2.11.0.jar;G:\\maven\\.m2\\repository\\com\\fasterxml\\jackson\\core\\jackson-core\\2.11.0\\jackson-core-2.11.0.jar;G:\\maven\\.m2\\repository\\com\\fasterxml\\jackson\\core\\jackson-databind\\2.11.0\\jackson-databind-2.11.0.jar;G:\\maven\\.m2\\repository\\com\\fasterxml\\jackson\\core\\jackson-annotations\\2.11.0\\jackson-annotations-2.11.0.jar;G:\\maven\\.m2\\repository\\com\\netflix\\hystrix\\hystrix-metrics-event-stream\\1.5.18\\hystrix-metrics-event-stream-1.5.18.jar;G:\\maven\\.m2\\repository\\com\\netflix\\hystrix\\hystrix-javanica\\1.5.18\\hystrix-javanica-1.5.18.jar;G:\\maven\\.m2\\repository\\org\\apache\\commons\\commons-lang3\\3.10\\commons-lang3-3.10.jar;G:\\maven\\.m2\\repository\\org\\ow2\\asm\\asm\\5.0.4\\asm-5.0.4.jar;G:\\maven\\.m2\\repository\\org\\aspectj\\aspectjweaver\\1.9.5\\aspectjweaver-1.9.5.jar;G:\\maven\\.m2\\repository\\com\\google\\guava\\guava\\15.0\\guava-15.0.jar;G:\\maven\\.m2\\repository\\io\\reactivex\\rxjava-reactive-streams\\1.2.1\\rxjava-reactive-streams-1.2.1.jar;G:\\maven\\.m2\\repository\\org\\reactivestreams\\reactive-streams\\1.0.3\\reactive-streams-1.0.3.jar;G:\\maven\\.m2\\repository\\org\\springframework\\cloud\\spring-cloud-starter-sleuth\\2.2.5.RELEASE\\spring-cloud-starter-sleuth-2.2.5.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\boot\\spring-boot-starter-aop\\2.3.0.RELEASE\\spring-boot-starter-aop-2.3.0.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\spring-aop\\5.2.6.RELEASE\\spring-aop-5.2.6.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\cloud\\spring-cloud-sleuth-core\\2.2.5.RELEASE\\spring-cloud-sleuth-core-2.2.5.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\spring-context\\5.2.6.RELEASE\\spring-context-5.2.6.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\springframework\\spring-expression\\5.2.6.RELEASE\\spring-expression-5.2.6.RELEASE.jar;G:\\maven\\.m2\\repository\\org\\aspectj\\aspectjrt\\1.9.5\\aspectjrt-1.9.5.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\brave\\brave\\5.12.3\\brave-5.12.3.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\reporter2\\zipkin-reporter-brave\\2.15.0\\zipkin-reporter-brave-2.15.0.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\brave\\brave-context-slf4j\\5.12.3\\brave-context-slf4j-5.12.3.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\brave\\brave-instrumentation-messaging\\5.12.3\\brave-instrumentation-messaging-5.12.3.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\brave\\brave-instrumentation-rpc\\5.12.3\\brave-instrumentation-rpc-5.12.3.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\brave\\brave-instrumentation-spring-web\\5.12.3\\brave-instrumentation-spring-web-5.12.3.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\brave\\brave-instrumentation-http\\5.12.3\\brave-instrumentation-http-5.12.3.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\brave\\brave-instrumentation-spring-rabbit\\5.12.3\\brave-instrumentation-spring-rabbit-5.12.3.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\brave\\brave-instrumentation-kafka-clients\\5.12.3\\brave-instrumentation-kafka-clients-5.12.3.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\brave\\brave-instrumentation-kafka-streams\\5.12.3\\brave-instrumentation-kafka-streams-5.12.3.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\brave\\brave-instrumentation-httpclient\\5.12.3\\brave-instrumentation-httpclient-5.12.3.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\brave\\brave-instrumentation-httpasyncclient\\5.12.3\\brave-instrumentation-httpasyncclient-5.12.3.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\brave\\brave-instrumentation-spring-webmvc\\5.12.3\\brave-instrumentation-spring-webmvc-5.12.3.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\brave\\brave-instrumentation-servlet\\5.12.3\\brave-instrumentation-servlet-5.12.3.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\brave\\brave-instrumentation-jms\\5.12.3\\brave-instrumentation-jms-5.12.3.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\reporter2\\zipkin-reporter-metrics-micrometer\\2.15.0\\zipkin-reporter-metrics-micrometer-2.15.0.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\reporter2\\zipkin-reporter\\2.15.0\\zipkin-reporter-2.15.0.jar;G:\\maven\\.m2\\repository\\io\\zipkin\\zipkin2\\zipkin\\2.21.1\\zipkin-2.21.1.jar;G:\\maven\\.m2\\repository\\cn\\hutool\\hutool-all\\5.7.13\\hutool-all-5.7.13.jar;G:\\maven\\.m2\\repository\\com\\github\\oshi\\oshi-core\\5.6.1\\oshi-core-5.6.1.jar;G:\\maven\\.m2\\repository\\net\\java\\dev\\jna\\jna\\5.8.0\\jna-5.8.0.jar;G:\\maven\\.m2\\repository\\net\\java\\dev\\jna\\jna-platform\\5.8.0\\jna-platform-5.8.0.jar;G:\\maven\\.m2\\repository\\org\\slf4j\\slf4j-api\\1.7.30\\slf4j-api-1.7.30.jar;G:\\maven\\.m2\\repository\\com\\alibaba\\fastjson\\1.2.73\\fastjson-1.2.73.jar;C:\\Program Files\\JetBrains\\IntelliJ IDEA 2020.1\\lib\\idea_rt.jar\" com.zhou.cloud.gateway.GatewayApplication",
    "name": "java",
    "path": "F:\\Program Files\\Java\\jdk1.8.0_261\\bin\\java.exe",
    "currentWorkingDirectory": "G:\\git\\gitee\\test\\springcloud\\alibaba\\demo1\\",
    "state": "RUNNING",
    "parentProcessID": 3992,
    "threadCount": 50,
    "priority": 8,
    "virtualSize": 1840398336,
    "residentSetSize": 322293760,
    "kernelTime": 3609,
    "userTime": 5656,
    "startTime": 1632650411099,
    "upTime": 323195,
    "bytesRead": 26935730,
    "bytesWritten": 271412,
    "openFiles": 1117,
    "bitness": 64,
    "threadDetails": [
        {
            "owningProcessId": 18528,
            "threadId": 6816,
            "name": "java/1",
            "state": "SLEEPING",
            "startMemoryAddress": 1249650224,
            "contextSwitches": 5275,
            "kernelTime": 0,
            "userTime": 0,
            "startTime": 1632650412273,
            "upTime": 326058,
            "priority": 10,
            "majorFaults": 0,
            "minorFaults": 0,
            "threadCpuLoadCumulative": 0
        },
        {
            "owningProcessId": 18528,
            "threadId": 20928,
            "name": "java/6",
            "state": "RUNNING",
            "startMemoryAddress": 1249650224,
            "contextSwitches": 3967,
            "kernelTime": 1468,
            "userTime": 2343,
            "startTime": 1632650425153,
            "upTime": 313178,
            "priority": 8,
            "majorFaults": 0,
            "minorFaults": 0,
            "threadCpuLoadCumulative": 0.01216879857461252
        },
        {
            "owningProcessId": 18528,
            "threadId": 22308,
            "name": "java/0",
            "state": "SLEEPING",
            "startMemoryAddress": 1249650224,
            "contextSwitches": 2042,
            "kernelTime": 140,
            "userTime": 62,
            "startTime": 1632650412257,
            "upTime": 326074,
            "priority": 8,
            "majorFaults": 0,
            "minorFaults": 0,
            "threadCpuLoadCumulative": 6.194912811202365E-4
        },
        {
            "owningProcessId": 18528,
            "threadId": 14024,
            "name": "java/9",
            "state": "SLEEPING",
            "startMemoryAddress": 1249650224,
            "contextSwitches": 4,
            "kernelTime": 0,
            "userTime": 0,
            "startTime": 1632650727436,
            "upTime": 10895,
            "priority": 8,
            "majorFaults": 0,
            "minorFaults": 0,
            "threadCpuLoadCumulative": 0
        },
        {
            "owningProcessId": 18528,
            "threadId": 17164,
            "name": "java/8",
            "state": "SLEEPING",
            "startMemoryAddress": 1249650224,
            "contextSwitches": 6,
            "kernelTime": 0,
            "userTime": 0,
            "startTime": 1632650562450,
            "upTime": 175881,
            "priority": 10,
            "majorFaults": 0,
            "minorFaults": 0,
            "threadCpuLoadCumulative": 0
        },
        {
            "owningProcessId": 18528,
            "threadId": 7504,
            "name": "java/11",
            "state": "SLEEPING",
            "startMemoryAddress": 1249650224,
            "contextSwitches": 2,
            "kernelTime": 0,
            "userTime": 0,
            "startTime": 1632650734342,
            "upTime": 3989,
            "priority": 8,
            "majorFaults": 0,
            "minorFaults": 0,
            "threadCpuLoadCumulative": 0
        },
        {
            "owningProcessId": 18528,
            "threadId": 14004,
            "name": "java/2",
            "state": "SLEEPING",
            "startMemoryAddress": 1249650224,
            "contextSwitches": 17,
            "kernelTime": 0,
            "userTime": 0,
            "startTime": 1632650412646,
            "upTime": 325685,
            "priority": 8,
            "majorFaults": 0,
            "minorFaults": 0,
            "threadCpuLoadCumulative": 0
        },
        {
            "owningProcessId": 18528,
            "threadId": 8948,
            "name": "java/3",
            "state": "SLEEPING",
            "startMemoryAddress": 1249650224,
            "contextSwitches": 12,
            "kernelTime": 0,
            "userTime": 0,
            "startTime": 1632650414858,
            "upTime": 323473,
            "priority": 9,
            "majorFaults": 0,
            "minorFaults": 0,
            "threadCpuLoadCumulative": 0
        },
        {
            "owningProcessId": 18528,
            "threadId": 22516,
            "name": "java/4",
            "state": "SLEEPING",
            "startMemoryAddress": 1249650224,
            "contextSwitches": 39,
            "kernelTime": 15,
            "userTime": 0,
            "startTime": 1632650416521,
            "upTime": 321810,
            "priority": 10,
            "majorFaults": 0,
            "minorFaults": 0,
            "threadCpuLoadCumulative": 4.661135452596253E-5
        },
        {
            "owningProcessId": 18528,
            "threadId": 15060,
            "name": "java/12",
            "state": "SLEEPING",
            "startMemoryAddress": 1249650224,
            "contextSwitches": 3,
            "kernelTime": 0,
            "userTime": 0,
            "startTime": 1632650734342,
            "upTime": 3989,
            "priority": 8,
            "majorFaults": 0,
            "minorFaults": 0,
            "threadCpuLoadCumulative": 0
        },
        {
            "owningProcessId": 18528,
            "threadId": 9816,
            "name": "java/5",
            "state": "SLEEPING",
            "startMemoryAddress": 1249650224,
            "contextSwitches": 3,
            "kernelTime": 0,
            "userTime": 15,
            "startTime": 1632650416527,
            "upTime": 321804,
            "priority": 8,
            "majorFaults": 0,
            "minorFaults": 0,
            "threadCpuLoadCumulative": 4.661222358951411E-5
        },
        {
            "owningProcessId": 18528,
            "threadId": 19256,
            "name": "java/10",
            "state": "SLEEPING",
            "startMemoryAddress": 1249650224,
            "contextSwitches": 5,
            "kernelTime": 0,
            "userTime": 0,
            "startTime": 1632650734097,
            "upTime": 4234,
            "priority": 9,
            "majorFaults": 0,
            "minorFaults": 0,
            "threadCpuLoadCumulative": 0
        },
        {
            "owningProcessId": 18528,
            "threadId": 13116,
            "name": "java/7",
            "state": "SLEEPING",
            "startMemoryAddress": 1249650224,
            "contextSwitches": 59,
            "kernelTime": 0,
            "userTime": 15,
            "startTime": 1632650425154,
            "upTime": 313177,
            "priority": 10,
            "majorFaults": 0,
            "minorFaults": 0,
            "threadCpuLoadCumulative": 4.789623759088311E-5
        }
    ],
    "affinityMask": 65535,
    "userID": "S-1-5-21-3577896018-3388594398-234401615-1421",
    "minorFaults": 98787,
    "groupID": "S-1-5-21-3577896018-3388594398-234401615-513",
    "user": "zhouyongjun",
    "group": "Domain Users",
    "majorFaults": 0,
    "processCpuLoadCumulative": 0.028666903881557574
}
     */
    @RequestMapping("/hutools/oshi/CurrentProcess")
    public Object oshiCurrentProcess() {
        return OshiUtil.getCurrentProcess();
    }

    @RequestMapping("/hutools/oshi/NetworkIFs")
    public Object oshiNetworkIFs() {
        return OshiUtil.getNetworkIFs();
    }
}

